<?php
echo "Mi token es: ".$GLOBALS['access_token'];
?>

<?php if ( $GLOBALS['user']): ?>
<?php
$data = array(
		"access_token" => $GLOBALS['access_token'],
		"link" => $GLOBALS['appUrl'],
		"name" => "Mi Raiz",
		"description" => "Crea tu propio arbol genealogico en Facebook",
		"caption" => "Arbol Genealogico",
		"picture" => "http://alkaos.com/images/523Icono_Logo_260x260jpg_tn.jpg"
	);
	$GraphFacebook_post		=	new GraphFacebook( $GLOBALS['userID'], $data );
	$GraphFacebook_post->Publish( );
?>
<?php else: ?>
<script type="text/javascript">window.top.location = '<?php echo $GLOBALS['loginUrl']; ?>';</script>

<?php endif; ?>